<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<link href="s_style.css" rel="stylesheet" type="text/css">
<script src="../../jquery.min.js"></script>
<script src="s_script.js"></script>
<body>
</body>
<script>

    /**
     *
     * @param options [{ico:url,name:name,event:function(){}}]
     */


    $(function(){
		$(document).sBindContextMenu(
		    [
		        {
		            name:'菜单1',
                    event:function(){
		                $(this).remove();
		                },
                    ico:'https://gss0.bdstatic.com/5foIcy0a2gI2n2jgoY3K/static/fisp_static/news/img/mod_baijia/icon-more_62ae436.png',
                    child:[{name:"奇怪的测试"}]
                },
                {
                    name:'菜单2',
                    event:function(){
                        alert("点击我不会关闭右键菜单哦");
                        return false;
                    },
                    css:["color:#F60"]
                },
                {
                    name:'菜单3',
                    event:function(){
                        alert("点击我会导致邮件菜单失效哦");
                        $(this).sUnbindContextMenu();
                    },
                    split:true
                },
                {
                    name:'菜单4有子菜单',
                    event:function(){

                    },
                    child:
                        [
                            {
                                name:"下级菜单"
                            },
                            {
                                name:"下级菜单2",
                                child:[
                                    {
                                        name:'第三级菜单',
                                        child:[
                                            {
                                                name:'第四级菜单，名字较长',
                                                ico:'https://gss0.bdstatic.com/5foIcy0a2gI2n2jgoY3K/static/fisp_static/news/img/columntitle/icon-more_7cf02b7.png',
                                                event:function(){
                                                    alert("更新了菜单")
                                                    $(this).updateOptions({name:'只有一个菜单了'})
                                                }
                                            }
                                            ]
                                    }
                                    ]
                            }
                            ]
                },
                {
                    name:'我是个被禁用的菜单',
                    split:true,
                    disable:true,
                    css:["color:#AAA"]
                }
                ]
        );
    })

</script>
</html>